﻿
/*----------------------------------------------------------------//
// 文件名：MoGbinfo.cs
// 文件功能描述：实体 MoGbinfo.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoGbinfo
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoGbinfo
    /// </summary>
    public partial class MoGbinfo : ICloneable
    {
        #region 表Gbinfo的字段
        private string gbCode;
        private string gbTitle;
        private string gbSubject;
        private int gbStatus;
        private string rem;
        #endregion

        #region 构造函数
        public MoGbinfo()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoGbinfo(MoGbinfo item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoGbinfo(string gbCode, string gbTitle, string gbSubject, int gbStatus, string rem)
        {
            this.gbCode = gbCode;
            this.gbTitle = gbTitle;
            this.gbSubject = gbSubject;
            this.gbStatus = gbStatus;
            this.rem = rem;
        }
        #endregion

        #region 表Gbinfo的字段属性
        /// <summary>
        /// GB_CODE
        /// </summary>
        public string GbCode
        {
            get { return gbCode; }
            set { gbCode = value; }
        }
        /// <summary>
        /// GB_TITLE
        /// </summary>
        public string GbTitle
        {
            get { return gbTitle; }
            set { gbTitle = value; }
        }
        /// <summary>
        /// GB_SUBJECT
        /// </summary>
        public string GbSubject
        {
            get { return gbSubject; }
            set { gbSubject = value; }
        }
        /// <summary>
        ///在用，还是作废。
        /// </summary>
        public int GbStatus
        {
            get { return gbStatus; }
            set { gbStatus = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoGbinfo CopyTo(MoGbinfo item)
        {
            item.gbCode = this.gbCode;
            item.gbTitle = this.gbTitle;
            item.gbSubject = this.gbSubject;
            item.gbStatus = this.gbStatus;
            item.rem = this.rem;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoGbinfo mo = new MoGbinfo();
            mo.GbCode = this.GbCode;
            mo.GbTitle = this.GbTitle;
            mo.GbSubject = this.GbSubject;
            mo.GbStatus = this.GbStatus;
            mo.Rem = this.Rem;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoGbinfo NewGbinfo = obj as MoGbinfo;
                if (NewGbinfo == null)
                {
                    return false;
                }
                else
                {
                    if (NewGbinfo.GbCode == this.GbCode && NewGbinfo.GbTitle == this.GbTitle && NewGbinfo.GbSubject == this.GbSubject && NewGbinfo.GbStatus == this.GbStatus && NewGbinfo.Rem == this.Rem)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "GbCode={0}/GbTitle={1}/GbSubject={2}/GbStatus={3}/Rem={4}", gbCode, gbTitle, gbSubject, gbStatus, rem);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["GB_Code"] != null && row["GB_Code"] != DBNull.Value)
            {
                this.GbCode = (string)row["GB_Code"];
            }
            else
            {
                this.GbCode = string.Empty;
            }
            if (row["GB_Title"] != null && row["GB_Title"] != DBNull.Value)
            {
                this.GbTitle = (string)row["GB_Title"];
            }
            else
            {
                this.GbTitle = string.Empty;
            }
            if (row["GB_Subject"] != null && row["GB_Subject"] != DBNull.Value)
            {
                this.GbSubject = (string)row["GB_Subject"];
            }
            else
            {
                this.GbSubject = string.Empty;
            }
            if (row["GB_Status"] != null && row["GB_Status"] != DBNull.Value)
            {
                this.GbStatus = (int)row["GB_Status"];
            }
            else
            {
                this.GbStatus = 0;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["GB_Code"] = this.GbCode;
            row["GB_Title"] = this.GbTitle;
            row["GB_Subject"] = this.GbSubject;
            row["GB_Status"] = this.GbStatus;
            row["Rem"] = this.Rem;
        }
        #endregion
    }
}
#endregion
